from tortoise import BaseDBAsyncClient


async def upgrade(db: BaseDBAsyncClient) -> str:
    return """
        ALTER TABLE `user` MODIFY COLUMN `phone` VARCHAR(11)   COMMENT '手机号';
        ALTER TABLE `user` MODIFY COLUMN `email` VARCHAR(20)   COMMENT '邮箱';
        ALTER TABLE `user` MODIFY COLUMN `nick_name` VARCHAR(20)   COMMENT '昵称';"""


async def downgrade(db: BaseDBAsyncClient) -> str:
    return """
        ALTER TABLE `user` MODIFY COLUMN `phone` VARCHAR(11) NOT NULL  COMMENT '手机号';
        ALTER TABLE `user` MODIFY COLUMN `email` VARCHAR(20) NOT NULL  COMMENT '邮箱';
        ALTER TABLE `user` MODIFY COLUMN `nick_name` VARCHAR(20) NOT NULL  COMMENT '昵称';"""
